<?php
/**
* @Author:       wonli
*/
session_start();
require '../../crossboot.php';

try{
    if (!empty($_SESSION["admin"])) {
        Cross::loadApp( 'admin' )->run();
    }
    else
    {
        Cross::loadApp( 'admin' )->get("Admin:login");
    }
} catch (Exception $e) {

    //检查是否已经安装
    $file = Loader::getFilePath( '::cache/install/install.Lock' );
    if(! file_exists($file)) {
        header("LOCATION:".str_replace(APP_NAME, 'install', SITE_URL));
    } else {
        throw new CoreException( $e->getMessage() );
    }
}
